-- card: 5067 from stack: in -- bmap block id: 0 -- flags: 0000 -- background id: 3493 -- name: trim -- part 1 (button) -- low flags: 00 -- high flags: A003 -- rect: left=88 top=211 right=233 bottom=188 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: trim leading ----- HyperTalk script ----- on mouseUp put "•" & editString("trimFld", background field "A","empty",TRUE,FALSE)& "•" into background field "B" end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: A003 -- rect: left=200 top=211 right=233 bottom=300 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: trim trailing ----- HyperTalk script ----- on mouseUp put "•" & editString("trimFld", background field "A","empty",FALSE,TRUE)& "•" into background field "B" end mouseUp -- part 3 (button) -- low flags: 00 -- high flags: A003 -- rect: left=311 top=211 right=233 bottom=411 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: trim both ----- HyperTalk script ----- on mouseUp put "•" & editString("trimFld", background field "A","empty",TRUE,TRUE)& "•" into background field "B" end mouseUp -- part contents for background part 2 ----- text ----- Trim will remove spaces from the front and/or the end of any text. The maximum size of the text (or data holder) is 30000 bytes. -- part contents for background part 1 ----- text ----- trimFld -- part contents for background part 3 ----- text ----- editString("trimFld", source, empty, leading, trailing) • source is the intput variable or field containing the text • empty is a string that the function will return if the input string is empty • leading is either TRUE or FALSE for trimming leading spaces • trailing is either TRUE or FALSE for trimming trailing spaces put editString("trimFld", field "A", "", TRUE, TRUE) into field "B" This function will return field A trimmed of both leading and trailing spaces. The boolean parameters are for trimming Leading and Trailing spaces respectively. It will also return a zero length string if field A is empty. -- part contents for background part 4 ----- text ----- hello there how are you -- part contents for background part 5 ----- text ----- •hello there how are you •